Skip to content

feat: add jit registry (CM-1299) - #4276

Merged
ulemons merged 4 commits into
mainfrom
fix/add-jitPack-registry
Jun 30, 2026
Merged

feat: add jit registry (CM-1299)#4276
ulemons merged 4 commits into
mainfrom
fix/add-jitPack-registry

Conversation

@ulemons

@ulemons ulemons commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Routes io.github.* and com.github.* Maven packages to JitPack instead of Maven Central. These packages follow JitPack's groupId convention (GitHub username as sub-namespace) and will never resolve on Central, causing ~649 packages to be permanently stuck as maven_not_on_central. With this change the enrichment loop fetches their metadata and POM from https://jitpack.io, which exposes the same standard Maven repository layout.

Changes

  • registry.ts — adds two entries to ALTERNATIVE_REGISTRIES for io.github and com.github prefixes pointing to JitPack (https://jitpack.io). The pageUrl lambda uses startsWith/slice rather than String.replace to avoid leaving the prefix in the URL when the groupId matches the bare prefix exactly.
  • registry.test.ts — adds 7 tests covering base URL resolution, page URL generation, prefix-boundary guard (io.githubfoo must not match), and the bare-prefix edge case.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

JIRA ticket

CM-1299


Note

Medium Risk
Changes external registry resolution and error handling for many Maven packages; misclassification of 401 is scoped to JitPack URLs only, but extra fallback HTTP calls add load and could mask rare edge cases.

Overview
Maven enrichment now tries Maven Central first for io.github.* and com.github.* (many artifacts live on Central), then falls back to JitPack when metadata is NOT_FOUND. A further Gradle Plugin Portal fallback runs for any still-missing package (except when GPP is already the primary registry for gradle.plugin.*).

Registry helpers add isJitpackNamespace, jitpackPageUrl, and shared base URL constants; browse URLs from the resolved fetch base now cover GPP and JitPack paths. Metadata fetch treats JitPack 401 as not-found (JitPack-only), so missing public builds do not look like auth errors.

Tests cover Central-as-primary for GitHub-style groupIds, fallback page URLs, namespace boundary checks, and JitPack URL shaping.

Reviewed by Cursor Bugbot for commit dfdf999. Bugbot is set up for automated code reviews on this repo. Configure here.

@ulemons ulemons self-assigned this Jun 29, 2026
Copilot AI review requested due to automatic review settings June 29, 2026 15:30
@ulemons ulemons added the Bug Created by Linear-GitHub Sync label Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Routes Maven groupIds with io.github.* / com.github.* prefixes to the JitPack Maven repository (https://jitpack.io) to unblock enrichment for packages that otherwise remain unresolved on Maven Central.

Changes:

  • Added io.github and com.github entries to ALTERNATIVE_REGISTRIES to resolve base URL and browse URL via JitPack.
  • Added unit tests for JitPack base URL resolution, browse URL generation, prefix-boundary behavior, and the bare-prefix edge case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
services/apps/packages_worker/src/maven/registry.ts Adds JitPack alternative-registry routing entries for io.github and com.github.
services/apps/packages_worker/src/maven/tests/registry.test.ts Adds tests validating the new JitPack routing and URL generation behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +102 to +106
// JitPack builds and serves artifacts directly from GitHub/GitLab/Bitbucket source repos.
// The io.github.<username> and com.github.<username> groupId conventions are JitPack-specific
// and will never resolve on Maven Central.
{
prefix: 'io.github',
Comment on lines +152 to +158
it('returns JitPack for io.github namespace', () => {
expect(resolveRegistryBaseUrl('io.github.resilience4j')).toBe('https://jitpack.io')
})

it('returns JitPack for bare io.github (exact match)', () => {
expect(resolveRegistryBaseUrl('io.github')).toBe('https://jitpack.io')
})

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 505c0dc. Configure here.

Comment thread services/apps/packages_worker/src/maven/metadata.ts Outdated
Copilot AI review requested due to automatic review settings June 30, 2026 08:33
Comment thread services/apps/packages_worker/src/maven/metadata.ts Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread services/apps/packages_worker/src/maven/registry.ts Outdated
Comment thread services/apps/packages_worker/src/maven/metadata.ts Outdated
ulemons added 4 commits June 30, 2026 11:51
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings June 30, 2026 09:52
@ulemons
ulemons force-pushed the fix/add-jitPack-registry branch from c444c4e to dfdf999 Compare June 30, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread services/apps/packages_worker/src/maven/registry.ts
Comment thread services/apps/packages_worker/src/maven/runMavenEnrichmentLoop.ts
@ulemons
ulemons merged commit 58ed2cd into main Jun 30, 2026
16 checks passed
@ulemons
ulemons deleted the fix/add-jitPack-registry branch June 30, 2026 10:18
skwowet pushed a commit that referenced this pull request Jul 3, 2026
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants